package Offer.offer2016;

import java.util.HashMap;

public class Test35 
{

	public static void main(String[] args)
	{
		String str="abbacdc";
		System.out.println(findNotRepeatingChar(str));

	}
	public static char findNotRepeatingChar(String str)
	{
		if(str==null||str.length()==0)
			return '\0';
		char[] ch=str.toCharArray();
		HashMap<Character,Integer> map = new HashMap<Character,Integer> ();
		for(int i=0;i<ch.length;i++)
		{
			if(map.get(ch[i])!=null)
			{
			    map.put(ch[i], map.get(ch[i])+1);
			}
			else
				map.put(ch[i],1);
		}
		for(int i=0;i<ch.length;i++)
		{
			if( map.get(ch[i])==1)
				return ch[i];
		}
		return '\0';
	}

}
